/**
 * Created by Sunny on 2018/3/1.
 */

// import router from './router/index';
// import fetch from './utils/fetch';
// const whiteList= ['/', '/login', '/welcome'];
/*
router.beforeEach((to, from, next) => {
  fetch('/session/check').then( response => {
    if (response.data.success) {
      if (to.path === '/login' || to.path === '/' || to.path === '/welcome') {
        next({ path: '/home' });
      } else {
        next();
      }
    } else {
      if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单，直接进入
        next();
      } else {
        next('/login'); // 否则全部重定向到登录页
      }
    }
  })
})

*/
